
<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="materialList.title"/></title>
    <meta name="heading" content="<fmt:message key='materialList.heading'/>"/>
    <meta name="menu" content="RoleMaterial"/>

</head>

<div id="help">
    <h2>
        <a href="<c:url value='helpMaterialList.html?decorate=false'/>"
           title="<fmt:message key='help.materialList'/>"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
            <fmt:message key="help"/>
        </a>
    </h2>
</div>

<c:set var="buttons">
    <input type="button" style="margin-right: 5px"
           onclick="location.href='<c:url value="/editMaterial.html"/>'"
           value="<fmt:message key="button.add"/>"/>

    <input type="button" onclick="location.href='<c:url value="/mainMenu.html"/>'"
           value="<fmt:message key="button.done"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false" />

<s:set name="materials" value="materials" scope="request"/>
<br><br>
<display:table name="materials" class="table" requestURI="" id="materialList" export="true" pagesize="25">
    <display:column href="editMaterial.html"
                    paramId="id" paramProperty="id"/>
    <display:column property="completeName" sortable="true" titleKey="material.name"/>
    <display:column property="description" sortable="true" titleKey="material.description"/>
    <display:column property="unitMeasure.name" sortable="true" titleKey="material.unitMeasureAbrev"/>
    <display:column property="unitMeasure.description" sortable="true" titleKey="material.unitMeasureFull"/>
    <display:column sortable="true" titleKey="material.state">
        <c:if test="${materialList.state=='true'}">
            <fmt:message key="true.available"/>
        </c:if>
    </display:column>

    <display:setProperty name="paging.banner.item_name" value="material"/>
    <display:setProperty name="paging.banner.items_name" value="materials"/>
    <display:setProperty name="export.excel.filename" value="Material List.xls"/>
    <display:setProperty name="export.csv.filename" value="Material List.csv"/>
    <display:setProperty name="export.pdf.filename" value="Material List.pdf"/>
    <display:setProperty name="paging.banner.some_items_found" value=""/>
    <display:setProperty name="paging.banner.all_items_found" value=""/>

</display:table>

<c:out value="${buttons}" escapeXml="false" />

<script type="text/javascript">
    highlightTableRows("materialList");
</script>